FROM openjdk:8-jdk-alpine
VOLUME /tmp
ENV active="prod"
ENV version=""
ENV TZ=Asia/Shanghai
# RUN sed -e 's/dl-cdn[.]alpinelinux.org/nl.alpinelinux.org/g' -i~ /etc/apk/repositories
RUN echo "http://mirrors.aliyun.com/alpine/v3.4/main/" > /etc/apk/repositories \
    && apk --no-cache add tzdata zeromq \
    && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
    && echo '$TZ' > /etc/timezone

ARG JAR_FILE
ADD ${JAR_FILE} app.jar
ENTRYPOINT ["sh","-c","java -jar app.jar --spring.profiles.active=$active --spring.cloud.nacos.discovery.metadata.version=$version"]